<ion-view view-title="我的求购一览">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
		<ion-nav-buttons side="right">
	        <button class="button button-clear icon ion-plus-circled" on-tap="onshow_mypbuy_edit()"></button>
	    </ion-nav-buttons>
	</ion-nav-bar>

    <div class="bar bar-subheader padding-bottom-0">
        <div class="row padding-0 text-center font-large-my light-bg">
            <div class="col" ng-class="selectTab==0?'top-activated':''" on-tap="activeTab(0)">
              	  全部
            </div>
            <div class="col" ng-class="selectTab==1?'top-activated':''" on-tap="activeTab(1)">
             	  进行中
            </div>
            <div class="col" ng-class="selectTab==2?'top-activated':''" on-tap="activeTab(2)">
              	  待审批
            </div>
            <div class="col" ng-class="selectTab==3?'top-activated':''" on-tap="activeTab(3)">
             	   已结束
            </div>
        </div>
    </div>
    <ion-content class="has-subheader">
        <ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
        <ion-slide-box delegate-handle="tab-handle" on-touch="onTouch()" on-release="onRelease()" draw-slide="false" on-slide-changed="slideChanged(index)" active-slide="slideIndex" show-pager="false">
            <!--全部-->
            <ion-slide>
                <li class="item item-divider">
                    <span on-tap="orderBy_time()">
		               	发布时间&nbsp;
		                <i class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'assertive':order==2}"></i>
		                <i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'assertive':order==1}"></i>
		            </span>
                </li>
                <div class="list" ng-repeat="obj in pbuylist.findgoods">
                    <li class="item item-input item-icon-right">
                        <b>{{obj.title}}</b>
                        <i class="icon ion-compose font-1rem-my positive" on-tap="onshow_mypbuy_edit(obj.id)" ng-if="obj.status==2||obj.status==4"></i>
                    </li>
                    <li class="item item-input item-borderless item-icon-right">
                     	   发布时间：{{obj.create_time}}
                        <i class="icon ion-android-cancel assertive font-1rem-my" on-tap="deleteOrder(obj.id)"></i>
                    </li> 
                    <li class="item" style="padding: 6px 2px 5px 16px;" ng-if="obj.type_count > 1">
                       	 求购量：{{obj.type_count}}种
                       	 <div class="right-zhang font-middle-my">
                            <span class="balanced" ng-if="obj.status==1">进行中</span>
                            <span class="energized" ng-if="obj.status==2">待审批</span>
                            <span ng-if="obj.status==3">已结束</span>
                            <span class="assertive" ng-if="obj.status==4">已拒绝</span>
                        </div>
                    </li>
                    <li class="item" style="padding: 6px 2px 5px 16px;" ng-if="obj.type_count == 1">
                       	求购量：{{obj.goods_count}}{{obj.goods_unit}}
                       	<div class="right-zhang font-middle-my">
                       		<span class="balanced" ng-if="obj.status==1">进行中</span>
                       		<span class="energized" ng-if="obj.status==2">待审批</span>
                       		<span ng-if="obj.status==3">已结束</span>
                       		<span class="assertive" ng-if="obj.status==4">已拒绝</span>
                       	</div>
                    </li>
                    <li class="item item-input"> <!--已拒绝都显示为0-->
                    	已有报价：<span class="assertive" ng-bind="obj.status==4?0:obj.offer_number"></span>条
                    </li>
                </div>
                <div class="font-large-my font-gray-my text-center padding" ng-if="pbuylist.findgoods.length==0||pbuylist.findgoods==null">
                    <i class="icon ion-sad-outline font-1rem-my"></i> 对不起，目前暂无求购信息...
                </div>
            </ion-slide>

            <!--进行中-->
            <ion-slide>
                <li class="item item-divider">
                    <span on-tap="orderBy_time()">
		 		 		发布时间&nbsp;
						<i class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'assertive':order==2}"></i>
						<i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'assertive':order==1}"></i>
			 		</span>
                </li>
                <div class="list" ng-repeat="obj in pbuylist.findgoods">
                    <li class="item item-input item-icon-right">
                        <b>{{obj.title}}</b>
                    </li>
                    <li class="item item-input item-borderless item-icon-right">
                        	发布时间：{{obj.create_time}}
                        <i class="icon ion-android-cancel assertive font-1rem-my" on-tap="deleteOrder(obj.id)"></i>
                    </li>
                    <li class="item item-input" ng-if="obj.type_count > 1">
                       	 求购量：{{obj.type_count}}种
                    </li>
                    <li class="item item-input" ng-if="obj.type_count == 1">
                       	 求购量：{{obj.goods_count}}{{obj.goods_unit}}
                    </li>
                    <li class="item item-input">
                    	已有报价：<span class="assertive" ng-bind="obj.offer_number"></span>条
                    </li>
                </div>
                <div class="font-large-my font-gray-my text-center padding" ng-if="pbuylist.findgoods.length==0||pbuylist.findgoods==null">
                    <i class="icon ion-sad-outline font-1rem-my"></i> 对不起，目前暂无求购中信息...
                </div>
            </ion-slide>

            <!--待审批-->
            <ion-slide>
                <li class="item item-divider">
                    <span on-tap="orderBy_time()">
		 		 		发布时间&nbsp;
						<i class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'assertive':order==2}"></i>
						<i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'assertive':order==1}"></i>
			 		</span>
                </li>
                <div class="list" ng-repeat="obj in pbuylist.findgoods">
                    <li class="item item-input item-icon-right">
                        <b>{{obj.title}}</b>
                        <i class="icon ion-compose font-1rem-my positive" on-tap="onshow_mypbuy_edit(obj.id)"></i>
                    </li>
                    <li class="item item-input item-borderless item-icon-right">
                       	 发布时间：{{obj.create_time}}
                        <i class="icon ion-android-cancel assertive font-1rem-my" on-tap="deleteOrder(obj.id)"></i>
                    </li>
                    <li class="item item-input" ng-if="obj.type_count > 1">
                       	 求购量：{{obj.type_count}}种
                    </li>
                    <li class="item item-input" ng-if="obj.type_count == 1">
                       	 求购量：{{obj.goods_count}}{{obj.goods_unit}}
                    </li>
                    <li class="item item-input">
                    	已有报价：<span class="assertive" ng-bind="obj.offer_number"></span>条
                    </li>
                </div>
                <div class="font-large-my font-gray-my text-center padding" ng-if="pbuylist.findgoods.length==0||pbuylist.findgoods==null">
                    <i class="icon ion-sad-outline font-1rem-my"></i> 对不起，目前暂无待审批信息...
                </div>
            </ion-slide>

            <!--已结束-->
            <ion-slide>
                <li class="item item-divider">
                    <span on-tap="orderBy_time()">
		 		 		发布时间&nbsp;
						<i class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'assertive':order==2}"></i>
						<i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'assertive':order==1}"></i>
			 		</span>
                </li>
                <div class="list" ng-repeat="obj in pbuylist.findgoods">
                    <li class="item item-input item-icon-right">
                        <b>{{obj.title}}</b>
                    </li>
                    <li class="item item-input item-borderless item-icon-right">
                       	 发布时间：{{obj.create_time}}
                    </li>
                    <li class="item item-input">
                       	 求购数量：{{obj.goods_count}}个
                    </li>
                    <li class="item item-input">
                    	已有报价：<span class="assertive" ng-bind="obj.offer_number"></span>条
                    </li>
                </div>
                <div class="font-large-my font-gray-my text-center padding" ng-if="pbuylist.findgoods.length==0||pbuylist.findgoods==null">
                    <i class="icon ion-sad-outline font-1rem-my"></i> 对不起，目前暂无已结束信息...
                </div>
            </ion-slide>
            </ion-slide-box>
            <ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
    </ion-content>
</ion-view>